package com.lh.pattern.proxy;

import java.io.File;
import java.net.URL;

public class TestTank {
	  public static void main(String[] args) throws Exception{  
		 System.out.println(System.getProperty("java.home")); 
		  File file = new File(System.getProperty("java.home"));
		  String[] defaultToolsLocation
          = { "lib", "tools.jar" };
          if (file.getName().equalsIgnoreCase("jre"))
              file = file.getParentFile();
          for (String name :defaultToolsLocation)
              file = new File(file, name);
          URL[] urls = {file.toURI().toURL()};
          System.out.println(urls.toString());
          Tank t = new Tank();  
          TimeInvocationHandler tlHandler= new TimeInvocationHandler(t);
         Moveable moveable = (Moveable) Proxy.newProxyIntenct(Moveable.class,tlHandler);  
          moveable.move();  
        
      }  
}
